package com.quwan.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author quan
 * @date 2021-12-08 21:19
 */
@Getter
@AllArgsConstructor
public enum RequestUriEnum {
    // 0-ios 1-wx 2-手机登录 3-密码 4-游客
    DEF(0, "", "默认"),
    PUBLISH_ORDER_DETAIL(1, "/app/publishOrderDetail", "发单内容详情"),
    BUYIT(2, "/app/order/buyIt", "发单下单页面"),
    PUBLISH_ORDER_LIST_SAME(3, "/app/orderList", "同城"),
    MEMBER_HOME(4, "/app/member/baseInfo", "主页"),
    DISPATCH_LIST(5, "/app/app/dispatch", "广场首页  派单"),
    MSG(6, "/app/im/unread", "消息"),
    CIRCLE(7, "/app/circle/list", "圈子"),
    ME(8, "/app/order/await/count", "我的"),
    AWAIT_PROCESS(9, "/app/order/memberServiceOrderList", "待处理"),
    AWAIT_DETAIL(10, "/app/order/consumeOrderDetails", "待处理详情"),
    PROCESSING(11, "/app/order/memberServiceOrderList", "进行中"),
    PROCESSING_DETAIL(12, "/app/order/consumeOrderDetails", "进行中详情"),
    PUBLISH_FINISH(13, "/app/order/memberServiceOrderList", "已完成"),
    PUBLISH_FINISH_DETAIL(14, "/app/order/consumeOrderDetails", "已完成详情"),
    BALANCE(15, "/app/member/purse", "余额"),
    PUBLISH_ORDER(16, "/app/order/publish", "发单"),
    REAL_AUTH(17, "/app/member/v2.5/identityChecked", "实名"),
    SPREAD(18, "/app/member/me/spread/data", "推广");

    Integer type;
    String uri;
    String tips;

    public static RequestUriEnum getByType(Integer type) {
        for (RequestUriEnum value : values()) {
            if (value.getType().equals(type)) {
                return value;
            }
        }
        return null;
    }

    public static RequestUriEnum getByUri(String url) {
        for (RequestUriEnum value : values()) {
            if (value.getUri().equalsIgnoreCase(url)) {
                return value;
            }
        }
        return null;
    }


}
